package com.cloudwise.monitoring_system.service.clickhouseService.impl;

import com.cloudwise.monitoring_system.annotation.DS;
import com.cloudwise.monitoring_system.dao.clickhouseDao.CkMonitorEventDao;
import com.cloudwise.monitoring_system.entity.MonitorEvent;
import com.cloudwise.monitoring_system.service.clickhouseService.CkMonitorEventService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author Reisen
 * @description: 监控告警项service实现类
 * @date 2021/6/3 9:19
 */
@Service("ckMonitorEventService")
public class CkMonitorEventServiceImpl implements CkMonitorEventService {
    @Resource
    private CkMonitorEventDao ckMonitorEventDao;

    /**
     * 查询所有监控告警信息
     * @param monitorEvent
     * @return
     */
    @DS("db2")
    @Override
    public List<MonitorEvent> queryAll(MonitorEvent monitorEvent) {
        return this.ckMonitorEventDao.queryAll(monitorEvent);
    }

    /**
     * 新增监控告警信息
     * @param monitorEvent
     * @return
     */
    @DS("db2")
    @Override
    public MonitorEvent insert(MonitorEvent monitorEvent) {
        this.ckMonitorEventDao.insert(monitorEvent);
        return monitorEvent;
    }
}
